<template>
  <div>
    <router-link :to="{ name: 'defaultDocSearch' }">
      <span :style="{ paddingLeft: '0px' }">
        <span :style="{ verticalAlign: 'middle' }"><img :style="{ maxWidth: '200px' }" src="~@/assets/logo.png"
            alt="logo"></span>
      </span>
      <span
        :style="{ verticalAlign: 'middle', fontSize: '25px', fontWeight: 'normal', color: '#FFFFFF', paddingLeft: '10px',fontFamilu:'Microsoft yahei'}">BDKEI数字图书馆</span>
    </router-link>
    <span v-if="title != ''"
      :style="{ verticalAlign: 'middle', fontSize: '20px', fontWeight: 'normal', color: '#FFFFFF', paddingLeft: '10px' }"> -> {{
        title }} </span>

    <span style="float: right;margin-top: 5px;">
      <span style="font-size:large;color: rgb(123, 178, 226);padding-right: 30px;">欢迎您，{{ nickname() }}！</span>
      <a-icon @click="jumpDraftsPage" type='folder' :style="{  fontSize:'23px',minWidth:'40px',color: '#6495ED'}" title="上传文件"/>
      <a-icon @click="jumpKmDocFavouritePage" type='star' title="收藏夹" :style="{  fontSize:'23px',minWidth:'40px',color: '#6495ED'}" />
      <a-icon @click="jumpManage()" type='setting' title="进入管理" :style="{  fontSize:'23px',minWidth:'40px',color: '#6495ED'}" />
      <user-menu style="margin-top: 2px;" />
      
    </span>
  </div>
</template>

<script>
import UserMenu from '@/components/tools/UserMenu'
import { mixin } from '@/utils/mixin.js'
import { mapGetters } from 'vuex'

export default {
  name: "SearchHeader",
  mixins: [mixin],
  components: { UserMenu },
  props: {
    title: {
      type: String,
      required: false,
      default: ''
    },
    theme: {
      type: String,
      required: false,
      default: 'white'
    }
  },
  data() {
    return {
    }
  },
  methods: {

    // 进入管理首页
    jumpManage() {
      this.$router.push('/dashboard/analysis');
    },
    // 跳转到收藏夹
    jumpKmDocFavouritePage() {
      this.$router.push('/km/filemanagement/KmDocFavouriteList');
    },
    // 跳转到个人草稿文件夹
    jumpDraftsPage() {
      this.$router.push('/km/filemanagement/DraftsList');
    },
    ...mapGetters(["nickname", "avatar","userInfo"]),
  }
}
</script>

